package com.hxzy.rocketmqproduce.consumer;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 监听 TestTopic话题所有的数据的
 */
@Component
@RocketMQMessageListener(consumerGroup = "testTopic-consumer02", topic = "testTopic",selectorExpression = "*")
public class TestTopicConsumer2  implements RocketMQListener<String> {


    @Override
    public void onMessage(String message) {
        System.out.println("线程"+Thread.currentThread().getId()+",组名：testTopic-consumer02，收到了消息:"+message);
    }
}
